package com.nf.service;

import com.nf.mapper.TestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TestServiceImpl implements TestService {

    @Autowired
    private TestMapper testMapper;

    @Transactional
    @Override
    public void 转账() {
        testMapper.数据库操作1();
        testMapper.数据库操作2();
    }
//    @Override
//    public void 转账() {
//        try {
//            testMapper.数据库操作1();
//            testMapper.数据库操作2();
//            System.out.println("全部提交");
//        }catch (Exception e){
//            e.printStackTrace();
//            System.out.println("异常信息:"+e.getMessage());
//            System.out.println("全部回滚");
//        }
//
//    }
}
